﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "IEventArgs.h"
#include "ElementId.h"
#include "RuntimeId.h"


namespace gcmp
{
    /// \brief 文档事件类型
    ///
    /// 
    enum class DocumentEventType : int32_t
    {
        Created,      ///< 文档创建
        Opened,       ///< 文档打开
        PreSave,      ///< 文档保存前
        Saved,        ///< 文档已保存
        PreClose,     ///< 文档关闭前
        Closed,       ///< 文档关闭
        Upgraded,      ///< 文档升级完成
        RecoveryWithDifferentSchema   ///< 崩溃恢复时发现不同版本的Schema
    };

    class IDocument;
    class IModelFileProperty;

    /// \brief  文档事件参数
    ///
    class GCMP_MODEL_INTERFACE_EXPORT IDocumentEventArgs : public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::IDocumentEventArgs, gcmp::IEventArgs);
    public:
        ///  \brief 获取文档事件类型
        ///
        /// \return 文档事件类型
        virtual DocumentEventType GetType() const = 0;

        ///  \brief 获取文档
        ///
        /// \return 文档
        virtual IDocument* GetDocument() const = 0;

        ///  \brief 获取当前文档里的模型数据文件信息
        ///
        /// \return 当前文档里的模型数据文件信息
        virtual const std::vector<IModelFileProperty*>& GetModelFilePropertys() = 0;
    };
}

